#ifndef FPGA_REVIVER_H
#define FPGA_REVIVER_H

#define SLAVE_ID 1 // MODBUS  RS485从机地址
#define TCP_PORT 502  //MODBUS  TCP 通信端口
#define REGN10 10  //位移数据高16位
#define REGN11 11  //位移数据低16位
#define REGN12 12  //李萨如图cos
#define REGN13 13  //李萨如图sin
#define REGN14 14  //读数头功耗
#define REGN15 15  //校正状态
#define REGN16 16  //校正指令
#define REGN17 17  //李萨如图校正前cos
#define REGN18 18  //李萨如图校正后sin
#define REGN23  23 //增益参数
#define REGN19  19 //测试增益参数

#include <Arduino.h>
#include <ModbusRTU.h>
#include "udp.h"
#ifdef ESP8266
 #include <ESP8266WiFi.h>
#else
 #include <WiFi.h>
#endif
#include <ModbusIP_ESP8266.h>
// extern int receivedData;

extern short cos_data  ;
extern short sin_data ;
extern short pre_cos_data ;
extern short pre_sin_data ;
extern int received_length_Data;
extern int received_cos_Data;
extern int received_sin_Data;
extern ModbusRTU mb;
extern ModbusIP mb_tcp; 
extern short H_data ;
extern short L_data ;
// extern  int receivedData;
extern byte send_cmd[7] ;   //sent cmd data's lenth is 9
extern HardwareSerial Serial_h;
void Serial_callback();
void fpga_reciver_init();

#endif